package com.rr.graphql.resolver;

import com.netflix.graphql.dgs.DgsComponent;
import com.netflix.graphql.dgs.DgsMutation;
import com.netflix.graphql.dgs.InputArgument;
import com.rr.dto.Department;
import com.rr.graphql.input.DepartmentInput;

import java.util.UUID;

/**
 * @author RR
 * @date 2023/6/11 17:24
 */

@DgsComponent
public class DepartmentMutationResolver {

    @DgsMutation
    public Department createDepartment(@InputArgument(name = "input") DepartmentInput input) {
        Department department = new Department();
        department.setId(UUID.randomUUID().toString());
        department.setName(input.getName());
        return department;
    }
}
